Skip to content

Nexus samples: use business IDs for workflow IDs#297

Open
VegetarianOrc wants to merge 1 commit intomainfrom
amazzeo/nexus-wf-id
Open

Nexus samples: use business IDs for workflow IDs#297
VegetarianOrc wants to merge 1 commit intomainfrom
amazzeo/nexus-wf-id

Conversation

@VegetarianOrc
Copy link
Copy Markdown
Contributor

What was changed

Stop using the Nexus request ID (nexus_cancel) or bare uuid4 (hello_nexus, nexus_multiple_args) as the backing workflow ID. Build a meaningful business ID from the operation input and append a uuid4 suffix for uniqueness.

Why?

Our samples should reflect best practices around creating meaningful IDs. Part of temporalio/features#692.

Stop using the Nexus request ID (nexus_cancel) or bare uuid4 (hello_nexus,
nexus_multiple_args) as the backing workflow ID. Build a meaningful business
ID from the operation input and append a uuid4 suffix for uniqueness.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@VegetarianOrc VegetarianOrc marked this pull request as ready for review April 24, 2026 19:23
@VegetarianOrc VegetarianOrc requested a review from a team as a code owner April 24, 2026 19:23
Copy link
Copy Markdown

@Evanthx Evanthx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown

@chrsmith chrsmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know this is all on the up and up. But do we still want to include a UUID in the "Workflow ID"? Since it isn't required for uniqueness (that's the "Run ID", right?) wouldn't this just lead to Workflow ID spam?

e.g. you'd want the Workflow ID to be something like "reticulate-splines_job-xxx" (so the workflow ID would be unique per-job, but not necessarily need its own UUID)?

I assume this is the "right way", mostly asking for my own understanding.

@VegetarianOrc
Copy link
Copy Markdown
Contributor Author

As far as I know this is all on the up and up. But do we still want to include a UUID in the "Workflow ID"? Since it isn't required for uniqueness (that's the "Run ID", right?) wouldn't this just lead to Workflow ID spam?

e.g. you'd want the Workflow ID to be something like "reticulate-splines_job-xxx" (so the workflow ID would be unique per-job, but not necessarily need its own UUID)?

I assume this is the "right way", mostly asking for my own understanding.

The workflow ID is the main tool used to identify a workflow after it's been started. The Run ID is useful for differentiating workflow runs that happen in various scenarios like a workflow that was continued-as-new. You're right that the workflow ID doesn't necessarily need its own UUID and could use some sequential job number or the like to use unique jobs. In many scenarios the differentiator in a workflow ID winds up being a UUID because the underlying business concept is also identified by a UUID (i.e. user id, order id, etc).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants